package data.transform;

import org.joda.time.LocalDate;


public class DateTransform  {

	public static LocalDate yahooCsvDateToLocalDate (String yahooCsvDateAsString) {

		String dateSplitted[] = yahooCsvDateAsString.split("-");

		int year = Integer.parseInt(dateSplitted[0]);
		int month = Integer.parseInt(dateSplitted[1]);
		int day = Integer.parseInt(dateSplitted[2]);

		return new LocalDate(year, month, day);

	}

	public static LocalDate wallStreetJournalCsvDateToLocalDate(String wallStreetJournalCsvDateAsString) {
		
		String dateSplitted[] = wallStreetJournalCsvDateAsString.split("/");

		int month = Integer.parseInt(dateSplitted[0]);
		int day = Integer.parseInt(dateSplitted[1]);
		int year = Integer.parseInt(dateSplitted[2]);

		return new LocalDate(year, month, day);
		
	}


}